/**
 * Created by zhoushg on 2017/9/29.
 */
import getData from './funcs/getData'
import {isEmptyObject, isEmptyStr, isRange} from './funcs/required'
import {toast} from '../utils/gui_main'
import { getToken } from '../utils/auth'
 // addCode
			// HkGU6JwXE Start
			
        export function GTOtest (params) { // test-查询
            var data = params
            return new Promise(resolve => {
            
            let data2 = {
              
            }
            params = data2
            params.token = getToken()
              function callBack (data) {
                resolve(data)
              }
              getData({
                url: '/test/data',
                method: 'get',
                params
              }, callBack)
            })
          }
        
			// HkGU6JwXE end
			
			// B1v7lRUX4 Start
			
        export function WEtest (params) { // test-查询
            var data = params
            return new Promise(resolve => {
            
            let data2 = {
              
            start: data.start, // 分页起始位置
            limit: data.limit // 分页显示条数
            }
            params = data2
            params.token = getToken()
              function callBack (data) {
                resolve(data)
              }
              getData({
                url: '/test/list',
                method: 'get',
                params
              }, callBack)
            })
          }
        
			// B1v7lRUX4 end
			
			// Sy7mgRLmN Start
		
        export function ADtest (data) { // test-新增
            var data = data
            return new Promise(resolve => {
            
        if (isEmptyStr(data.name)) {
          toast.warn('姓名不能为空')
          resolve(false)
          return
        }
            let data2 = {
              
            name: data.name, // 姓名
            type: data.type, // 类型
            age: data.age, // 年纪
            arr: data.arr, // 数组类型测试
            obj: data.obj, // 对象类型测试
            bol: data.bol, // bool类型测试
            date: data.date // 时间类型测试
            }
            data = data2
            data.token = getToken()
              function callBack (data) {
                resolve(data)
              }
              getData({
                url: '/test/add',
                method: 'post',
                data
              }, callBack)
            })
          }
        
		// Sy7mgRLmN end
			
			
			
			
			
			
			